extends /templates/base-flat

block page_nav
  include ./teacher-dashboard-nav.jade

block content
  if me.isAnonymous() || (!me.isTeacher() && !view.classrooms.size())
    .access-restricted.container.text-center.m-y-3
      h5(data-i18n='teacher.access_restricted')
      p(data-i18n='teacher.teacher_account_required')
      if me.isAnonymous()
        .login-button.btn.btn-lg.btn-primary(data-i18n='login.log_in')
        a.btn.btn-lg.btn-primary-alt(href="/teachers/signup" data-i18n='teacher.create_teacher_account')
      else
        a.btn.btn-lg.btn-primary(href="/teachers/update-account" data-i18n="teachers_quote.convert_account_title")
        button#logout-button.btn.btn-lg.btn-primary-alt(data-i18n="login.log_out")

    .teacher-account-blurb.text-center.col-xs-6.col-xs-offset-3.m-y-3
      h5(data-i18n='teacher.what_is_a_teacher_account')
      p(data-i18n='teacher.teacher_account_explanation')

  else
    if !me.isTeacher()
      .alert.alert-danger.text-center
        .container
          // DNT: Temporary
          h3 ATTENTION: Please upgrade your account to a Teacher Account.
          p
            | We are transitioning to a new improved classroom management system for instructors.
            | Please convert your account to ensure you retain access to your classrooms. 
          a.btn.btn-primary.btn-lg(href="/teachers/update-account") Upgrade to teacher account
      
    .container.m-t-5
      h3(data-i18n='teacher.enrollments')
      h4
        span(data-i18n='teacher.enrollments_blurb_1')
        span  2&ndash;8 
        span(data-i18n='teacher.enrollments_blurb_2')
        
      .row.m-t-3
        .col-xs-4
          +enrollmentStats
        .col-xs-4
          +addCredits
        .col-xs-3.col-xs-offset-1
          +howToEnroll
      +quoteSection
      
mixin enrollmentStats
  h5
    span(data-i18n='teacher.credits_available')
    span.spr :
    = view.prepaids.totalAvailable()
  //- .small-details
  //-   span(data-i18n='teacher.total_unique_students')
  //-   span.spr :
  //-   = view.members.length
  //- .small-details
  //-   span(data-i18n='teacher.total_enrolled_students')
  //-   span.spr :
  //-   = view.prepaids.totalRedeemers()
  //- .small-details
  //-   span(data-i18n='teacher.unenrolled_students')
  //-   span.spr :
  //-   = (view.members.length - view.prepaids.totalRedeemers())
  //- .enroll-students.btn.btn-lg.btn-navy
  //-   | Enroll Students

mixin addCredits
  .text-center
    h5(data-i18n='teacher.add_enrollment_credits')
    div.m-t-1
      //- input#students-input.text-center.enrollment-count(value=view.numberOfStudents type='number')
      input#students-input.text-center.enrollment-count(value=15 type='number')
    div.m-t-1
      if view.state === 'purchasing'
        .purchase-now.btn.btn-lg.btn-forest.disabled
          span(data-i18n='teacher.purchasing')
      else if view.state === 'purchased'
        .purchase-now.btn.btn-lg.btn-forest
          span(data-i18n='teacher.purchased')
      else
        .purchase-now.btn.btn-lg.btn-forest
          span(data-i18n='teacher.purchase_now')

mixin howToEnroll
  .how-to-enroll.small-details
    .text-center
      b(data-i18n='teacher.how_to_enroll')
    ol
      li.m-t-1(data-i18n='teacher.how_to_enroll_blurb_1')
      li.m-t-2(data-i18n='teacher.how_to_enroll_blurb_2')
      li.m-t-2(data-i18n='teacher.how_to_enroll_blurb_3')

mixin quoteSection
  .text-center.m-t-5
    h4(data-i18n='teacher.bulk_pricing_blurb')
    a.request-quote.btn.btn-lg.btn-navy.m-t-2(href='/teachers/demo')
      span(data-i18n='teachers_quote.title')
